<?php
require_once('src/vo/BaseVO.php');

class PlayerStatsVO extends BaseVO {
      public $name;
      public $kills;
      public $deaths;
      public $suicides;
      public $killratio;
      public $score;
      public $power;
      public $wins;      
      public $games;	
      public $playerStatsKilled;
      public $playerStatsLost;
      public $flagStatsKilled;
      public $flagStatsLost;
      
      public function __construct() {
        $this->kills = 0;
        $this->deaths = 0;
        $this->suicides = 0;
        $this->killratio = 0;
        $this->score = 0;
        $this->power = 0;
        $this->wins = 0;
        $this->games = 0;      
        $this->playerStatsKilled = array();
        $this->playerStatsLost = array(); 
        $this->flagStatsKilled = array(); 
        $this->flagStatsLost = array(); 
      }       
      
      public function init($players, $flags) {          
          // init playerstats
          foreach($players as $player) {
            $this->playerStatsKilled[$player->name] = 0;
            $this->playerStatsLost[$player->name] = 0;
          }
  
          // init flagstats
          foreach($flags as $flag) {
            $this->flagStatsKilled[$flag->acronym] = 0;
            $this->flagStatsLost[$flag->acronym] = 0;
          }
       }                                 
}
?>